package com.sunxd.vue.application.controller;

import com.sunxd.vue.application.facade.InteractiveActivityFacade;
import com.sunxd.vue.bean.Response;
import com.sunxd.vue.bean.request.InteractiveActivityQueryRequest;
import com.sunxd.vue.bean.request.InteractiveActivityRequest;
import com.sunxd.vue.bean.response.InteractiveActivityInfo;
import com.sunxd.vue.infrastructure.adapter.db.base.Paging;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sun.xd
 * @description: description
 * @date 2024/4/25 9:46
 */
@RestController
@RequestMapping("interactive")
@RequiredArgsConstructor
public class InteractiveActivityController {

    private final InteractiveActivityFacade interactiveActivityFacade;

    @PostMapping(value = "create")
    public Response<Boolean> create(@RequestBody InteractiveActivityRequest request) {
        return interactiveActivityFacade.create(request);
    }

    @PostMapping(value = "update")
    public Response<Boolean> update(@RequestBody InteractiveActivityRequest request) {
        return interactiveActivityFacade.update(request);
    }

    @PostMapping(value = "detail")
    public Response<InteractiveActivityInfo> detail(@RequestBody InteractiveActivityRequest request) {
        return interactiveActivityFacade.detail(request);
    }

    @PostMapping(value = "page")
    public Response<Paging<InteractiveActivityInfo>> page(@RequestBody InteractiveActivityQueryRequest request) {
        return interactiveActivityFacade.page(request);
    }

}
